﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace ZMQtoSMSService
{
    public class SMSSend
    {
        public static ILog logger = log4net.LogManager.GetLogger("");

        public static void SendSms_Action(SMSModel sMSModel)
        {
            ServiceReference1.sendSmsRequest Send = new ServiceReference1.sendSmsRequest();
            Send.guestType = 3;
            Send.syscode = sMSModel.senderid;
            Send.empcode = sMSModel.sysid;
            Send.userid = sMSModel.senderid;
            Send.msg = sMSModel.message;
            Send.tasked = "-1";
            ServiceReference1.SpSmsClient client = new ServiceReference1.SpSmsClient();
            try
            {
                ServiceReference1.ActionResult result =
                    client.sendSms(Send.empcode, Send.guestType, Send.msg,
                        Send.qpower, Send.tasked, Send.pid, Send.callresid,
                        Send.userid, Send.depcode, Send.syscode, Send.paraminfo,
                        Send.clientMsgid);
            }
            catch (Exception ex)
            {
                logger.Debug("短信平台服务无响应"+ex.Message);

            }
        }
    }
}
